<template>
  <div>
    <Modal
      v-model="modal1"
      title="订单相关状态"
      @on-ok="ok"
      @on-cancel="cancel"
    >
      <span>支付状态:</span><span>{{paystatus}}</span><br><br>
      <span>出库状态:</span><span>{{states}}</span><br><br>
      <Button type="success" long @click="cd">催单</Button>
      <br>
    </Modal>
  </div>
</template>

<script>
export default {
  props: {
    oid: String,
    show: Boolean,
  },
  data() {
    return {
      modal1: false,
      paystatus:"支付状态",
      states:"出库状态",
      datas:{}
    };
  },
  methods: {
    ok() {
      this.$emit("change1", false);
    },
    cancel() {
      this.$emit("change2", false);
      this.modal1 = false;

    },
    cd(){
      this.axios.post('api/cd',{cd:"cd"}).then((r)=>{
        this.$Message.info(r.data)
      }).catch((e)=>{
        this.$Message.error("e"+e)
      })
    }
  },
  watch: {
    show(nd) {
      this.modal1 = nd;
    },
    oid(nd){
      var param=JSON.stringify({action:"order",oid:nd})
        this.axios.get('/api/ss',{params:{param:param}}).then((r)=>{
            this.paystatus=r.data.paystatus
            this.states=r.data.states
        }).catch((e)=>{
            this.$Message.error("e"+e)
        })
    }
  },
};
</script>

<style>
</style>